<?php
include "header.php";
?>
<script>change_picture("calculator");</script>
<script>
function submit_form(action_url){
	$("#degreeinfo_form").attr("action", action_url);
	$("#degreeinfo_form").submit();
}
</script>
<div>
<h1>Course Schedule Calculator</h1>
<div class = "step_nav">
<a href = "#" onclick = "submit_form('calculator_1.php');"><div id = "step_1" class = "step_button step_on" ></div></a>
<a href = "#" onclick = "submit_form('calculator_2.php');"><div id = "step_2" class = "step_button step_off" ></div></a>
<a href = "#" onclick = "submit_form('calculator_3.php');"><div id = "step_3" class = "step_button step_off" ></div></a>
<a href = "#" onclick = "submit_form('calculator_4.php');"><div id = "step_4" class = "step_button step_off" ></div></a>
</div>
<div class = "step_text">Enter your degree information.</div>
<div class = "form_field" style = "padding-left: 180px;">
<form id = "degreeinfo_form" method = "POST">
<table class = "frame formtable">
<tr>
<td><label for = "major" >Your Major: </label></td>
<td>
<select name = "major">
<option value="CS" <?php if (isset($major) && $major == 'CS') echo "Selected";?>>Computer Science</option>
<option value="IS" <?php if (isset($major) && $major == 'IS') echo "Selected";?>>Information System</option>
<option value="CyS" <?php if (isset($major) && $major == 'CyS') echo "Selected";?>>CyberSecurity</option>
</select>
</td>
</tr>
<tr>
<td><label>Entry Time (Year / Term): </label></td>
<td>
<select name = "entry_year">
<?php
$time = getdate();
for ($i = $time["year"]; $i>2006; $i--){
	echo "<option value = '" . $i . "' ";
	if (isset($entry_year) && $entry_year == i){
		echo "Selected";
	}
	echo " >" . $i . "</option>";
}
?>
</select>
<select name = "entry_term" >
<option value="1" <?php if (isset($entry_term) && $entry_term == 1) echo "Selected";?>>Spring</option>
<option value="2" <?php if (isset($entry_term) && $entry_term == 2) echo "Selected";?>>Fall</option>
</select>
</td>
</tr>
<tr>
<td><label>Desired Graduate Time (Year / Term): </label></td>
<td>
<select name = "graduate_year">
<?php
$time = getdate();
for ($i = $time["year"]; $i<$time["year"] + 10; $i++){
	echo "<option value = '" . $i . "' ";
	if (isset($graduate_year) && $graduate_year == i){
		echo "Selected";
	}
	echo " >" . $i . "</option>";
}
?>
</select>
<select name = "graduate_term" >
<option value="1" <?php if (isset($graduate_term) && $graduate_term == 1) echo "Selected";?>>Spring</option>
<option value="2" <?php if (isset($graduate_term) && $graduate_term == 2) echo "Selected";?>>Fall</option>
<option value="3" <?php if (isset($graduate_term) && $graduate_term == 3) echo "Selected";?>>Summer 1</option>
<option value="4" <?php if (isset($graduate_term) && $graduate_term == 4) echo "Selected";?>>Summer 2</option>
</select>
</td>
</tr>
</table>
<div class = "next_back">
<a href = "#" onclick = "submit_form('calculator_2.php');"><div class = "next button"></div></a>
</div>
</form>
</div>
</div>
<?php
include "footer.php";